//-------------------------------------------------------------------------------------
//autofight
function fight()
	{
	if(GM_getValue('fightRandom', '') == "checked") //fight the next person on the fightUsers list
		{
		var victim=fightUsers[0][0];
		// roll the current victim to the last spot on the fight list
		fightUsers.push(fightUsers.shift());
		//---------------  Store fight lists for next page load
		GM_setValue('fightUsers', uneval(fightUsers));
		window.location = "http://apps.facebook.com/"+SCRIPT.name+"/fight.php?opponent_id="+victim+"&action=attack";
		flag = 1;
		}
	else if(GM_getValue('freshMeat', '') == "checked")
		{
		setTimeout("document.location ='" + "http://apps.facebook.com/"+SCRIPT.name+"/fight.php?opponent_id= &action=face_friend_invite"+"'", delay);
		}
	else if (GM_getValue('rFightList', '') == "checked")
		{
		//Get values from config
		var randomFL = GM_getValue('fightList', '').split('\n');
		var randomindex=Math.floor(Math.random()*randomFL.length);
		window.location = "http://apps.facebook.com/"+SCRIPT.name+"/fight.php?opponent_id="+parseInt(randomFL[randomindex])+"&action=attack";
		}
	}



